﻿<UserControl x:Class="SampleApplication.View.CustomerListView" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             mc:Ignorable="d" d:DesignHeight="607" d:DesignWidth="954" 
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
             xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
             xmlns:cal="http://www.caliburnproject.org"
             d:DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=CustomerListViewModel}">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="305*" />
            <RowDefinition Height="400*" />
        </Grid.RowDefinitions>
        <sdk:DataGrid AutoGenerateColumns="True" Name="Customers" ItemsSource="{Binding Customers}" SelectedItem="{Binding CurrentCustomer, Mode=TwoWay}" Grid.RowSpan="1" />
        <toolkit:DataForm Grid.Row="1" Name="CurrentCustomer" ItemsSource="{Binding Customers}" CurrentItem="{Binding CurrentCustomer, Mode=TwoWay}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="EditEnded">
                    <cal:ActionMessage MethodName="Save" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </toolkit:DataForm>
    </Grid>
</UserControl>